import { EntitySchema } from '@mikro-orm/core';

export class ImsYzdKpStorageList {
  id!: number;
  groupId: number = 0;
  url!: unknown;
  path!: unknown;
  type!: number;
  addTime!: string;
  updateTime!: string;
  uniacid!: number;
  title!: unknown;
  size!: number;
  uid!: number;
  ossType!: number;
  height!: number;
  width!: number;
  duration?: number;
  data?: unknown;
}

export const ImsYzdKpStorageListSchema = new EntitySchema({
  class: ImsYzdKpStorageList,
  properties: {
    id: { primary: true, type: 'number' },
    groupId: { type: 'number', default: 0, index: 'group_id' },
    url: { type: 'unknown', columnType: 'longtext' },
    path: { type: 'unknown', columnType: 'longtext' },
    type: { type: 'number' },
    addTime: { type: 'string', length: 255 },
    updateTime: { type: 'string', length: 255 },
    uniacid: { type: 'number', index: 'uniacid' },
    title: { type: 'unknown', columnType: 'longtext' },
    size: { type: 'number' },
    uid: { type: 'number' },
    ossType: { type: 'number' },
    height: { type: 'number' },
    width: { type: 'number' },
    duration: { type: 'number', nullable: true },
    data: { type: 'unknown', columnType: 'longtext', nullable: true },
  },
});
